# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-async
pkgname=('python2-async' 'python-async')
_pkgname=async
pkgver=0.6.2
pkgrel=9
pkgdesc='Async aims to make writing asyncronous processing easier.'
arch=('any')
url='https://pypi.org/project/async/#files'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('6d3376e2d40e07a402cdcc17d0b1789883d5aa5fa24931ed0bfd98bf32454fd126b3591e3c0dc3acea37c0bfe0d27cc65df42a44c92f0bd13e4bbb7a477ff69c')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-async() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-async() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

